package app.sys.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import app.sys.data.comm.ApiResult;
import app.sys.data.entity.SysLog;
import app.sys.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author fyy
 * @date 2023/5/4 10:49
 * @description: 日志controller
 */
@RestController
@RequestMapping("/sysLog")
public class SysLogController {
    @Autowired
    private SysLogService service;

    @PostMapping("/pageList")
    public ApiResult<Page<SysLog>> pageList(Page page, @RequestBody SysLog form) {
        QueryWrapper<SysLog> wrapper = new QueryWrapper<>(form);
        wrapper.eq("del_flag","0");
        Page<SysLog> pageList = service.page(page, wrapper);
        return ApiResult.of(pageList);
    }
}
